<template>
  <div>
    <el-container>
      <el-header>
        <div class="headera">
          <!-- 导航LOGO -->
          <div>
            <i class="el-icon-s-data" />
            <b class="Logo">****</b>
          </div>
          <div class="">
            <el-menu
              default-active="2"
              class="el-menu-demo"
              router
              background-color="#64CBC6"
              text-color="white"
              active-text-color="black"
              mode="horizontal"
            >
              <MenuTree :menuData="this.menuData" />
            </el-menu>
          </div>
        </div>
      </el-header>

      <el-header class="headerb">
        <!-- 信息 -->
        <div>
          <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>活动管理</el-breadcrumb-item>
            <el-breadcrumb-item>活动列表</el-breadcrumb-item>
            <el-breadcrumb-item>活动详情</el-breadcrumb-item>
          </el-breadcrumb>
        </div>

        <div>
          <el-dropdown>
            <span class="el-dropdown-link">
              <el-avatar
                shape="square"
                :size="40"
                :src="HeadPortrait"
              ></el-avatar
              ><i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item icon="el-icon-plus">个人中心</el-dropdown-item>
              <router-link :to="{ path: 'About' }">
                <el-dropdown-item icon="el-icon-circle-plus"
                  >首页</el-dropdown-item
                ></router-link
              >
              <router-link :to="{ path: '/' }">
                <el-dropdown-item icon="el-icon-circle-plus-outline"
                  >退出登录</el-dropdown-item
                ></router-link
              >
            </el-dropdown-menu>
          </el-dropdown>
        </div>
        <div class="userinfo">
          <span>Hello！{{ this.Uname }}</span>
        </div>
      </el-header>

      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>
<script>
import MenuTree from "../components/MenuTree"; //1.引用组件
export default {
  components: {
    MenuTree, //2.挂载
  },
  data() {
    return {
      menuData: [],
      Uid: sessionStorage.getItem("UserID"),
      Uname: sessionStorage.getItem("UserName"),
      HeadPortrait: sessionStorage.getItem("HeadPortrait"),
    };
  },
  created() {
    this.GetMenu();
  },
  computed: {},
  methods: {
    GetMenu() {
      console.log(this.Uid);
      this.$http.get(`Menud/getmenus?Uid=` + this.Uid).then((res) => {
        this.menuData = res.data;
      });
    },

  },
};
</script>
<style scoped>
.el-header,
.el-footer {
  text-align: center;
  height: 130px;
  margin: 0;
  padding: 0;
}
.headera {
  height: 60px;
  background-color: #64cbc6;
}
.headerb {
  height: 50px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
.el-main {
  color: #333;
  height: 590px;
  background-color: #eeeeee;
}
.Logo {
  width: 200px;
  line-height: 55px;
  font-size: 30px;
  float: left;
  font-family: 幼圆;
  margin-left: -30px;
}
.el-icon-s-data {
  margin-left: 30px;
  float: left;
  line-height: 55px;
  font-size: 30px;
}
.userinfo {
  float: right;
  margin-top: 30px;
  margin-right: 30px;
}
.el-dropdown {
  float: right;
  margin-right: 5%;
  margin-top: 10px;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.demonstration {
  display: block;
  color: #8492a6;
  font-size: 14px;
  margin-bottom: 20px;
}
.el-breadcrumb {
  float: left;
  margin-left: 24px;
  font-size: 15px;
  margin-top: 23px;
}
</style>
<style>
.el-menu-demo {
  width: 1250px;
  float: left;
}
body {
  margin: 0;
  padding: 0;
}
</style>
